function ChartPositionList() {
	var pathList = $("path");
	pathList.each(function() {
		var targetid = $(this).attr("id");
		ChartPosition(targetid);
	});
}

function ChartPosition(targetid) {
	var chartid = targetid + "chart";
	var chartBox = null;
	chartBox = $("#" + chartid);
	if (chartBox == null || typeof (chartBox[0]) == "undefined") {
		return;
	}

	var svgElement = document.getElementById('SvgElement');
	var svgPoint = svgElement.createSVGPoint();

	var sx = 0, sy = 0;
	var e = svgElement;
	while (e != null) {
		sx += e.offsetLeft;
		sy += e.offsetTop;
		e = e.offsetParent;
	}

	var circle = $("#" + targetid);
	svgPoint.x = circle.attr("cx");
	svgPoint.y = circle.attr("cy");
	var screenPoint = trans(svgPoint, svgElement);

	if (screenPoint.x > sx + parseFloat($("#SvgElement").css("width"))
			|| screenPoint.x < sx
			|| screenPoint.y > sy + parseFloat($("#SvgElement").css("height"))
			|| screenPoint.y < sy) {
		chartBox.hide();
		return;
	}
	chartBox.show();
	var width = parseFloat(chartBox.css("width"));
	var height = parseFloat(chartBox.css("height"));
	var left = screenPoint.x - width / 2 - 250;
	var top = screenPoint.y - height / 2;
	var str = "position:absolute;left:" + left + "px;top:" + top + "px;";
	chartBox[0].setAttribute("style", str);
}

function Config() {
	// 璺緞閰嶇疆
	require.config({
		paths : {
			'echarts' : 'echarts',
			'echarts/chart/bar' : 'echarts'
		}
	});
}

function DrawDiv(chartType, targetid, dataArray) {
	Config();
	var chartid = targetid + "chart";
	var chartBox = null;
	chartBox = $("#map").find("#" + chartid);
	if (typeof (chartBox[0]) != "undefined") {
		chartBox[0].remove();
	}
	var map = $("#map");
	var boardDiv = "<div id='" + chartid + "' class='chartClass'><\/div>";
	map.append(boardDiv);
	ChartPosition(targetid);
	DrawChart(chartType, chartid, dataArray);
}